<template>
  <div id="title">
    <ul id="title-ul">
      <li><img src="../../assets/common/back.png" alt="" @click="goBack"></li>
      <li>{{desc}}</li>
      <li><img src="../../assets/shortProduct/productDetail/buyCarpng.png" alt=""></li>
      <li><img src="../../assets/common/share.png" alt="" @click="isshow = true"></li>
      <li><router-link :to="{path: '/home'}"><img src="../../assets/shortProduct/productDetail/home.png" alt=""></router-link></li>

    </ul>
    <!--show-->
    <transition name="slideDown" >
      <div v-show="isshow" class="v_show">
        <ul class="v_uls">
          <li>
            <div>
              <img src="../../assets/mustbuy/pengyouquan.png" alt="">
              <p>微信朋友圈</p>
            </div>
            <div>
              <img src="../../assets/mustbuy/weixin.png" alt="">
              <p>微信好友</p>
            </div>
            <div>
              <img src="../../assets/mustbuy/QQ.png" alt="">
              <p>QQ好友</p>
            </div>
          </li>
          <li>
            <div>
              <img src="../../assets/mustbuy/QQkongjian.png" alt="">
              <p>QQ空间</p>
            </div>
            <div>
              <img src="../../assets/mustbuy/weibo.png" alt="">
              <p>微博</p>
            </div>
            <div>
              <img src="../../assets/mustbuy/fuzhilianjie.png" alt="">
              <p>复制链接</p>
            </div>
          </li>
        </ul>
        <p @click="isshow = false" class="v_show_p">取消</p>
      </div>
    </transition>
  </div>
</template>
<script>
  export default {
    data() {
      return{
        isshow: false,
      }
    },
      props:{
        title: {
          type: String,
        },
        desc: {
          type: String,
          default: '默认值',
          required: true
        },
      },
    methods:{
        goBack() {
          this.$router.go(-1);
        }
    },

  }
</script>
<style scoped>
  #title{
    width: 100%;
    height: 4.8rem;
    background-color: #e53e42;
    color: white;
    position: relative;
  }
  #title-ul li{
    display: inline-block;
    font-size: 1.8rem;
  }
  #title-ul {
    width:calc(100% - 2rem);
    height: 2rem;
    position: absolute;
    top:1.5rem;
    left: 1rem;
    right: 1rem;
  }
  #title-ul li:nth-child(1) img{
    width:1.2rem;
    height: 1.9rem;
    position: absolute;
    top:0;
    left: 0;
  }
  #title-ul li:nth-child(2){
    width:17rem;
    text-align: center;
    position: absolute;
    top:0;
    left:calc(50% - 8.5rem);
  }
  #title-ul li:nth-child(3) img{
    width:1.8rem;
    height: 1.8rem;
    position: absolute;
    top:0;
    right: 5.6rem;
  }
  #title-ul li:nth-child(4) img{
    width:1.8rem;
    height: 1.8rem;
    position: absolute;
    top:0;
    right: 2.8rem;
  }
  #title-ul li:nth-child(5) img{
    width:1.8rem;
    height: 1.8rem;
    position: absolute;
    top:0;
    right: 0;
  }
  /*show*/
  .v_show_p {
    padding: 0.5rem 2.5rem 0.5rem 2.5rem;
    font-size: 1.2rem;
    background: red;
    border-radius: 5px;
    color: white;
    margin-top: 1rem;
    width: 8.5rem;
    margin: auto;
  }
  .v_show{
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    background: white;
    padding-top: 3rem;
    padding-bottom: 1rem;
    z-index: 10;
    color: black;
  }
  .v_uls li {
    display: flex;
    justify-content: space-around;
  }
  .v_uls li div {
    width: 6rem;
    margin-bottom: 1rem;
  }
  .v_uls img {
    width: 3.2rem;
  }
  .slideDown-enter, .slideDown-leave-to{
    opacity: 0;
    transform: translateY(5rem);
  }
  .slideDown-enter-active, .slideDown-leave-active{
    transition: all 0.8s;
  }
</style>
